<extend name="Base/common"/>
<block name="side">
    <div class="sidebar">
        <ul class="side-nav">
            <li >
                <a href="{:U('Home/Dealer/add')}" <if condition="$action eq 'add'">class="active"</if> ><i class="fa-new"></i> 添加记录</a>
            </li>
            <li>
                <a href="{:U('Home/Dealer/index')}"  <if condition="$action eq 'index'">class="active"</if> ><i class=" fa-history"></i> 历史记录</a>
            </li>
            <li>
                <a href="{:U('User/profile')}" <if condition="$action eq 'profile'">class="active"</if> ><i class="fa-pass"></i> 修改密码</a>
            </li>
            <li>
                <a href="{:U('User/logout')}" <if condition="$action eq 'logout'">class="active"</if> ><i class="fa-back"></i> 退出系统</a>
            </li>
        </ul>
    </div>
</block>
<block name="body">

    <div id="main-content">
        <div id="main" class="main" style="min-height: 380px;">
            <div class="row">
                <h1>历史记录</h1>
                <div class="admin">
                    欢迎 <span style="color: red;">{:get_nickname()}</span> 登陆系统
				</div>
				<include file="Public/dashboardhd"/>
            </div>
            <div class="search-form">
                <form action="{:U('Index/search')}" method="post" >

                    <div class="sleft">
                        <span class="search-title">车牌号码</span>
                        <input class="search-input" type="text" placeholder="" value="{:I('plate_number','')}" name="plate_number">
                        <span class="search-title">审核状态</span>
                        <div class="dropdown1">
                            <select id="status" class="form-control" name="status">
                                <option value="" selected = "selected"></option>
                                <option value="0">未审核</option>
                                <option value="1">已通过</option>
                                <option value="2">未通过</option>
                                <option value="3">已删除</option>
                            </select>
                        </div>
                    </div>
                    <input type="hidden" name="controller" value="{$CONTROLLER_NAME}">
                    <input type="hidden" name="action" value="{$ACTION_NAME}">
                    <button class="btn " target-form="ids" type="submit">搜索</button>
                </form>

            </div>
            <div class="table-responsive">
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <th>查看结算单</th>
                            <th>活动形式</th>
                            <th>提交时间</th>
                            <th>车牌号码</th>
                            <th>轮胎备件号</th>
                            <th>轮胎条数</th>
                            <th>补贴金额</th>
                            <th>审核状态</th>
                            <th>操作</th>
                            <th>原因</th>
                        </tr>
                    </thead>
                    <tbody>

                        <volist name="list" id="info" key="key">
                            <tr class="record" data-id="{$key}" data-picture="{:get_file($info['statement'],'path')}">
                                <p class="statement_picture" style="display:none;">{:get_file($info['statement'],'path')}</p>
                                <td class="jump-img red">
                                    <volist name=":get_images($info['images'])" id="img">
                                        <a class="img" data-src="{$img.path}" style="cursor:pointer;text-decoration:underline;margin: 0 3px;">查看</a>
                                    </volist>
                                </td>
                                <td>{$info['type']==1?'形式一':'形式二'}</td>
                                <td title="{$info.created_at|date='Y-m-d H:i:s',###}">{$info.created_at|date='Y-m-d',###}</td>
                                <td>{$info.plate_number}</td>
                                <td>{$info.tyre_number}</td>
                                <td>{$info['type']==1?4:$info['number']*2}</td>
                                <td>
                                    <if condition="$info.status eq 1">
                                        ￥{$info.price}
                                    <else/>
                                        --
                                    </if>
                                </td>
                                <if condition="$info.status eq 0">
                                    <td class="orange">未审核</td>
                                    <elseif condition="$info.status eq 1" />
                                    <td class="green">已通过</td>
                                    <elseif condition="$info.status eq 2" />
                                    <td class="red">未通过</td>
                                    <elseif condition="$info.status eq 3" />
                                    <td class="gray">已删除</td>
                                </if>

                                <td>
                                    <if condition="$info['status'] eq 2">
                                        <button class="change btn" style="cursor: pointer;"  data-action="redirect" data-src="{:U('Dealer/edit',['id'=>$info['id']])}">修改</button>
                                        <else />
                                        --
                                    </if>
                                </td>
                                <td>
                                    <if condition="$info['cause']">
                                        {$info.cause}
                                        <else />
                                        --
                                    </if>
                                </td>

                                <!--<td>-->
                                    <!--<if condition="$info.checked_at gt 0">-->
                                        <!--{$info.checked_at|date='Y-m-d',###}-->
                                        <!--<else />-->
                                        <!-- - -->
                                    <!--</if>-->
                                <!--</td>-->



                            </tr>
                        </volist>
                    </tbody>
                </table>
            </div>
            <div class="page">
                <div>
                    {$_page}
                </div>
            </div>
        </div>
    </div>

    <include file="var"/>
</block>
<include file="Public/dashboard"/>
